package com.vates.curso.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public interface GenericDao<T, PK extends Serializable> {

	/**
	 * Insert a new Object into the database.
	 * 
	 * @param object
	 */

	public T save(T object);

	/**
	 * Delete a detached Object from the database.
	 * 
	 * @param object
	 */
	public void remove(PK id);

	/**
	 * Finds all Objects in the database.
	 * 
	 * @return
	 */
	public List<T> getAll();

	public List<T> getAllDistinct();

	public T get(PK id);

	public boolean exists(PK id);

	public List<T> findByNamedQuery(String queryName,
			Map<String, Object> queryParams);

}
